package com.xingkeduo.business.order.remote;

import com.alibaba.fastjson.JSONObject;
import com.xingkeduo.business.order.remote.feign.StoreFeignService;
import com.xingkeduo.dto.param.HairstyleResponseDTO;
import com.xingkeduo.utils.ResponseUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author chi  2019-03-13 10:43
 **/
@Service
public class HairstyleRemoteService {

    @Resource
    private StoreFeignService storeFeignService;

    public HairstyleResponseDTO getByHairId(Long id) {
        try {
            JSONObject object = new JSONObject();
            object.put("id", id);
            ResponseUtils<HairstyleResponseDTO> responseUtils = storeFeignService.getHair(object.toString());
            if (responseUtils.success()) {
                return responseUtils.getData();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
